<!-- 左侧列表式模板 -->
<template>
  <div class="template-body">
    <section class="left-side">
      <leftAsideList :propsData="propsData" :catList="catList"></leftAsideList>
    </section>
    <section class="template-content">
      <classifyAd :propsData="propsData"></classifyAd>
      <section class="goodsContent">
        <template  v-if="styleType == 7">
          <goodsList :propsData="propsData" :goodsList="catList[0].goods_list || []"></goodsList>
        </template>
        <template v-if="styleType == 1">
          <classifyGoods :propsData="propsData" v-for="(item,index) in catList[0].children" :key="index" :cat="item"></classifyGoods>
        </template>
      </section>
    </section>
  </div>
</template>

<script>
import leftAsideList from "../components/leftAsideList/index.vue";
import classifyAd from "../components/classifyAd/index.vue";
import goodsList from "../components/goodsList/index.vue";
import classifyGoods from "../components/classifyGoods/index.vue";

export default {
  name: "",
  props: {
    propsData: {
      type: Object,
      default: {},
    },
    catList:{
      type: Array,
      default: () =>{
        return []
      }
    }
  },
  mixins: [],
  components: { leftAsideList, classifyAd, goodsList,classifyGoods },
  data() {
    return {};
  },
  mounted() {
    console.log(this.catList,"cat1");
  },
  watch: {},
  computed: {
    styleType() {
      return this.propsData.params.styleType || "1";
    },
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.template-body {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  padding-top: 6px;
  .left-side {
    width: 101px;
    background: #f2f2f2;
    height: 100%;
  }
  .template-content {
    flex: 1;
    height: 100%;
    background: #ffffff;
    overflow-x: hidden;
    overflow-y: scroll;
    .goods-section {
      width: 100%;
      // height: 100%;
      padding: 0 16px;
    }
    .lable-title {
      width: 100%;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 7px 16px 0;
      span {
        font-size: 14px;
        font-family: PingFang SC;
        font-weight: 600;
        color: #262626;
      }
      .iconfont {
        color: #888888;
        font-size: 12px;
        display: block;
        transform: scale(0.8);
      }
    }
    .goodsContent {
      width: 100%;
      padding: 5px 16px;
    }
  }
  .template-content::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
}
</style>
